<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="format-detection" content="telephone=no" />
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>{if isset($data.seo_title) && $data.seo_title !==''}{$data.seo_title}{elseif isset($data_seo.seo_title) &&  $data_seo.seo_title !==''/}{$data_seo.seo_title}{else /}{/if}</title>
    <meta charset="UTF-8" name="keywords" content="{if isset($data.seo_keywords) && $data.seo_keywords !==''}{$data.seo_keywords}{elseif isset($data_seo.seo_keywords) &&  $data_seo.seo_keywords !==''}{$data_seo.seo_keywords}{else /}{/if}">
    <meta charst="UTF-8" name="description" content="{if isset($data.seo_description) && $data.seo_description !==''}{$data.seo_description}{elseif isset($data_seo.seo_description) &&  $data_seo.seo_description !==''}{$data_seo.seo_description}{else /}{/if}">
    <link rel="stylesheet" type="text/css" href="/static/wap/css/main.css">
    <link rel="stylesheet" type="text/css" href="/static/wap/css/alert.css">
    <link rel="stylesheet" type="text/css" href="/static/wap/css/swiper.min.css">
    <link rel="stylesheet" type="text/css" href="/static/wap/css/animate.min.css">
    <meta name="viewport" content="initial-scale=1,maximum-scale=1, minimum-scale=1">
    <script>
        function resize() {
            var htmlEle = document.documentElement;

            var htmlWidth = window.innerWidth;
            htmlEle.style.fontSize = 20 / 640 * htmlWidth + 'px';
        } resize();
    </script>
    <style>
        .mobile-inner-nav a{
            -webkit-animation-duration: 0.5s;
            animation-duration: 0.5s;
            -webkit-animation-fill-mode: both;
            animation-fill-mode: both;
            -webkit-animation-name: returnToNormal;
            animation-name: returnToNormal;
        }
                
        @-webkit-keyframes returnToNormal {
          0% {
            opacity: 0;
            -webkit-transform: translate3d(0, -400%, 0);
                    transform: translate3d(0, -400%, 0);
          }
    
          400% {
            opacity: 1;
            -webkit-transform: none;
                    transform: none;
          }
        }
    
        @keyframes returnToNormal {
          0% {
            opacity: 0;
            -webkit-transform: translate3d(0, -400%, 0);
                    transform: translate3d(0, -400%, 0);
          }
    
          400% {
            opacity: 1;
            -webkit-transform: none;
                    transform: none;
          }
        }
    </style>
</head>
<body>

{include file="public/header"}

<!--<div class="banner">
    <ul class="swiper-wrapper clearfix">

        <li class="swiper-slide">
            <a class="pc-banner"> <img src="/static/wap/img/banner.jpg" /></a>
        </li>
        <li class="swiper-slide">
            <a class="pc-banner"> <img src="/static/wap/img/banner.jpg" /></a>
        </li>
        <li class="swiper-slide">
            <a class="pc-banner"> <img src="/static/wap/img/banner.jpg" /></a>
        </li>
        <li class="swiper-slide">
            <a class="pc-banner"> <img src="/static/wap/img/banner.jpg" /></a>
        </li>
    </ul>
    <div class="swiper-pagination">
    </div>  
</div>-->
<div class="kznr1">
    <img src="/static/wap/img/每周客照.jpg" alt="">
</div>
<div class="kznr2">
    <div class="daohang">
        <div class="year">
            <div class="model-select-box">
                <div class="model-select-text" data-value="" id="max-year">{$data['ps_time']|date='Y',###}</div>
                <ul class="model-select-option">


                    {volist name="data_year"  id="v" key="k"}
                    <li data-option="{$k}" {if isset($year) && $year == $v['nian']}  {/if} class="seleced">{$v['nian']}</li>
                    {/volist}
                </ul>
            
            <img src="/static/wap/img/向下.png" alt="">
            </div>
        </div>
        <div class="wrapper wrapper01" id="retr">
                <div class="yue scroller">  
                    <ul class="clearfix" id="momth-li">
                        {volist name="month" id="v" key="k"}
                        <li {if isset($v['class'])}  onclick="getWorks(this,{$k})"  {/if} value="{$k}" class="{if isset($v['class'])}{$v['class']} {/if} {if date('m',$data['ps_time']) == $k } cur1 {/if}   "  data-id="{$k}"><a  href="javascript:;">{$v[0]}</a></li>
                        {/volist}

                    </ul>
                </div>
        </div>
    </div>
    <div class="zhou">
        {volist name="week" id="v" key="k"}
        <div onclick="getWorks_(this,{$k})"  data-id="{$k}" {if $data['week'] == $k}class="cur"{/if}>{$v}</div>

        {/volist}

    </div>
<input id="month-val" value="{$data['ps_time']|date="n",###}" type="hidden">
    <div class="biaoti1">
        {$data.title}
    </div>
    <div class="yulan">
        {if isset($data.imgurl)}
        {volist name="data.imgurl" id="v"}
        <div class="yl-main">
            <img src="{$v.works_pic}" alt="">
        </div>
        {/volist}
        {/if}
    </div>
<div class="more">
    {if isset($upId)}
    <div class="zuo">
        <a href="/wap/guest/nr/id/{$upId}">上一组</a>
    </div>
    {else}
    <div class="syx1">
          上一组
    </div>
    {/if}
    {if isset($downId)}
    <div class="you">
        <a href="/wap/guest/nr/id/{$downId}">下一组</a>
    </div>
    {else}
    <div class="syx2">
        下一组
    </div>

    {/if}
</div>

</div>
{include file="public/foot"}
<script>
    var type=1;
    function getWorks(obj,month) {

        year =$("#max-year").html();
        $('#momth-li li').removeClass('cur1');
        getweekData(year,month);
        $('.zhou div').removeClass('cur1');

        $(obj).addClass('cur1');
        $("#month-val").val(month);
        type =2;
    }


    function getWorks_(obj,week){

        $(obj).addClass('cur');
        var month = $("#month-val").val();
        var year = $("#max-year").html();
        $.post('/wap/guest/getworks_content',{week:week,month:month,year:year},function(res){
            if(res.code==1){
                window.location.href='/wap/guest/nr/id/'+res.data.id+'';

            }else{
                $('#duotu').empty();
                $('#duotu').append('暂无数据');
            }


        })

    }

    var year =$("#max-year").html();
    var month = $("#month-val").val();
    getweekData(year,month);
    function getweekData(year,month){
        var zhou  ='<?php  if(isset($data['week'])){ echo $data['week'];}?>';
        $.post('/wap/guest/getweek',{year:year,month:month},function(res){
            if(res.code==1){
                var html='';
                for(i in res.data){
                    var str ='';
                    var str_2 ='';
                    var shijian=''
                    var week =parseInt(i)+1;
                    if(res.data[i]['class'] !== undefined){

                        str ='wxz';
                        url ='javascript:;';
                        shijian ='onclick="getWorks_(this,'+week+')"'
                        //url ='/index/guest/y/'+year+'/m/'+month+'';
                    }else{
                        str ='';
                        var shijian=''
                        url ='javascript:;';
                    }

                    if(zhou == week && type==1){
                        str_2='cur';

                    }


                    html+=' <div '+shijian+'  data-id="'+week+'"  class="'+str+' '+str_2+'">'+res.data[i][0]+'</div>';
                }
                $('.zhou').empty();
                $('.zhou').append(html);
            }
        })
    }


</script>
<script>

    $(function(){
        /*
         * 模拟网页中所有的下拉列表select
         */
        function selectModel(){
            var $box = $('div.model-select-box');
            var $option = $('ul.model-select-option', $box);
            var $txt = $('div.model-select-text', $box);
            var speed = 10;
            /*
             * 单击某个下拉列表时，显示当前下拉列表的下拉列表框
             * 并隐藏页面中其他下拉列表
             */
            $txt.click(function(e) {
                $option.not($(this).siblings('ul.model-select-option')).slideUp(speed, function(){
                    int($(this));
                });
                $(this).siblings('ul.model-select-option').slideToggle(speed, function(){
                    int($(this));
                });
                return false;
            });
            //点击选择，关闭其他下拉
            /*
             * 为每个下拉列表框中的选项设置默认选中标识 data-selected
             * 点击下拉列表框中的选项时，将选项的 data-option 属性的属性值赋给下拉列表的 data-value 属性，并改变默认选中标识 data-selected
             * 为选项添加 mouseover 事件
             */
            $option.find('li').each(function(index, element) {
                if($(this).hasClass('seleced')){
                    $(this).addClass('data-selected');
                }
            })
                .mousedown(function(){
                    type=2;
                    $(".zhou div").removeClass('cur');
                    $(".zhou div").removeClass('wxz');
                    var year = $(this).html();
                    $.post('/wap/guest/changedate',{year:year},function(res){
                        if(res.code==1){
                            var html='';
                            var kz='';
                            for(i in res.data){
                                var str ='';
                                var shijian=''
                                if(res.data[i]['class'] !== undefined){
                                    var month =parseInt(i)+1;
                                    str ='wxz';
                                    url ='javascript:;';
                                    shijian ='onclick="getWorks(this,'+month+')"'
                                    //url ='/index/guest/y/'+year+'/m/'+month+'';
                                }else{
                                    str ='';
                                    var shijian=''
                                    url ='javascript:;';
                                }
                                html +='<li class="'+str+'" '+shijian+'>' +
                                    '<a href="'+url+'"  >'+res.data[i][0]+'</a>' +
                                    '</li>';
                            }
                            $('#momth-li').empty();
                            $('#momth-li').append(html);




                        }
                    })


                    $(this).parent().siblings('div.model-select-text').text($(this).text())
                        .attr('data-value', $(this).attr('data-option'));

                    $option.slideUp(speed, function(){
                        int($(this));
                    });
                    $(this).addClass('seleced data-selected').siblings('li').removeClass('seleced data-selected');
                    return false;
                })
                .mouseover(function(){
                    $(this).addClass('seleced').siblings('li').removeClass('seleced');
                });
            //点击文档，隐藏所有下拉
            $(document).click(function(e) {
                $option.slideUp(speed, function(){
                    int($(this));
                });
            });
            //初始化默认选择
            function int(obj){
                obj.find('li.data-selected').addClass('seleced').siblings('li').removeClass('seleced');
            }
        }

        selectModel();
    })
</script>

</html>